{luaVersion ? "lua53", luaPkgs ? [], pkgs ? import <nixpkgs> {}}:

# E.g.  --arg luaVersion \"lua53\" --arg luaPkgs '[ "lgi" ]'

with pkgs;

let
  luaPackages = builtins.getAttr (luaVersion + "Packages") pkgs;
in

mkShell {
  buildInputs = with luaPackages; [
    lua luacheck
  ] ++ map (x :builtins.getAttr x luaPackages) luaPkgs;
}
